/*****************************************************************************/
/* CS 230 Final Project                                                      */
/* graph.h					                                                 */
/*                                                                           */
/* Created by Even Cheng and Shu-Chi Hsu                                     */
/* Copyright 2011 GNU GPL v3                                                 */
/*****************************************************************************/

#ifndef GRAPH_H
#define GRAPH_H

#include "global.h"
#include <Windows.h>

class graph 
{
public:
	graph();
	~graph();

	node nodes[MAX_NODE_NUMBER];
	channelInfo channels[MAX_CHANNEL_NUMBER];
	HDC hdc;
	void Readmap();
	void Showmap(int);
	void humancontact();

	node getNode(int nodeID);
	void setNode(node thisNode);
	// 0: fail, 1: succeed
	int send(int senderID, messageInfo *msg);
	int receive(int recipientNodeID, messageInfo *msg);

	int getSendDelay(int channelNum, node sender);
	int getTransmissionDelay(int channelNum, node sender, node recipient);
	int getRecvDelay(int channelNum, node recipient);

	bool wantsToSendMessage(node senderNode, float prob);
	int getChannelUsed(node senderNode, float prob);

	double getDistance(node sender, node recipient);
	int getUserType(int randomResult);
	int* getChannelPreference(int userType);
private:
	int nodes_number;
};
#endif